﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using System.Xml;

namespace XNAGame_Lab1
{
    public class Zoombie : MyXNAButton
    {
        int _Damp;

        public int Damp
        {
            get { return _Damp; }
            set { _Damp = value; }
        }
        String _Name;

        public String Name
        {
            get { return _Name; }
            set { _Name = value; }
        }
        int _HP;//mau

        public int HP
        {
            get { return _HP; }
            set { _HP = value; }
        }
        double _Def;//suc tan cong

        public double Def
        {
            get { return _Def; }
            set { _Def = value; }
        }
        /// <summary>
        /// chien luoc thit hay mat troi
        /// </summary>
        GameStrategy _GameStategy;

        public GameStrategy GameStategy
        {
            get { return _GameStategy; }
            set { _GameStategy = value; }
        }
        public Zoombie(ContentManager content, List<string> strTexture, int nSprites, Vector2 topleft, Vector2 size, int cost, GameStrategy stategy)
            : base(content, strTexture, nSprites, topleft, size)
        {
            this.Cost = cost;
            this._GameStategy = stategy;
        }

        public Zoombie(ContentManager content, string refix, int nSprites, Vector2 topleft, Vector2 size, int cost, GameStrategy stategy)
            : base(content, refix, nSprites, topleft, size)
        {
            this.Cost = cost;
            this._GameStategy = stategy;
        }

        public Zoombie(ContentManager content, string strXML)
            : base(content, strXML)
        {

        }
        public virtual void AnimalMove()
        {
            
            if (this._TopLeft.X < 800)
            {
                Vector2 posion = this.TopLeft;
                posion.X++;
                this.TopLeft = posion;
            }
            else
            {
                List<MySprites2D> tmp = this.Sprites;
                this.Sprites[0].nTextures = 15;
            
            }
            //            if(this._TopLeft.X==)
            //            if(this._TopLeft.X == 
        }
        public override void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
          //  AnimalMove();
            base.Draw(gameTime, spriteBatch);
        }
        public override void Update(GameTime gameTime)
        {
         //   AnimalMove();
            base.Update(gameTime);
        }
        /// <summary>
        /// ham kiem tra va cham 
        /// </summary>
        public virtual bool isCollide(Zoombie zoombie)
        {
            if (CollisionDetection2D.BoundingRectangle(
                (int)this._TopLeft.X, (int)this._TopLeft.Y, (int)this._Size.X,
               (int)this._Size.Y
               , (int)zoombie._TopLeft.X,
               (int)zoombie._TopLeft.Y,
              (int)zoombie._Size.X,
               (int)zoombie._Size.Y))

                return true;
            return false;
            
        }

        /// <summary>
        /// event 
        /// </summary>
        /// <returns></returns>
        public bool isDie()
        {
            if (this.HP == 0)
                return true;
            return false;
        }


    }
}
